package main

import (
	"fmt"
	"os/exec"
	"strings"
	"time"
)

func main() {
	for {
		time.Sleep(time.Second * 10)
		str := time.Now().Format("2006-01-02 15:04:05")
		str = strings.Replace(str, "-", "", -1)
		str = strings.Replace(str, ":", "", -1)
		str = strings.Replace(str, " ", "", -1)

		cmd := exec.Command("/bin/bash", "-c", "raspivid -o "+str+".h264 -t 600000")
		err := cmd.Run()
		if err != nil {
			fmt.Println(err)
		}
	}
}
